<template>

</template>

<script>
    var token='';
    var device_id='1532658064';
    var version='1.0.1';
    var platform='h5';
    var page = 1;
    var u = navigator.userAgent;
    var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
    var isIos = u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
    if(isAndroid){
        if(window.android){
            if(window.android!=null&&typeof(window.android)!="undefined"){
                var tokenStr=window.android.callUserInfo();
                var tokenObj=JSON.parse(tokenStr);
                token=tokenObj.token;
                device_id=tokenObj.device_id;
                version=tokenObj.version;
                platform=tokenObj.platform;
            }else{
            }
        }
    }else if(isIos){
        if(window.webkit){
            window["callUserInfo"] = function(res) {
                var tokenStr=res;
                var tokenObj=JSON.parse(tokenStr);
                token=tokenObj.token;
                device_id=tokenObj.device_id;
                version=tokenObj.version;
                platform=tokenObj.platform;
            }

        }

    }
    export default {
        platform,
        version,
        page,
        device_id,
        token,
        isAndroid,
        isIos,
    }
</script>

<style scoped>

</style>
